<?php
//$ad = $this->db->where("position","under_title")->from('ad')->get()->row();
if(!empty($ad)){
    if(
        isset($this->user->id)
        &&   isset($article->id)
    ){
        $user_id = $this->user->id;
        if($user_id > 0){
            $this->load->model('Adaccount');
            $adaccount = new Adaccount();
            $adaccount->add_view($ad->id,$user_id);
        }
    }
?>


<script type="text/html"  id="ad_position_2">
    <br>
    <img
            onclick="location.href='<?php t_(isset($ad->url)?$ad->url:'')?>'"
            style="width: 100%;height: 100%;"
            src="<?php t_(isset($ad->pic)?$ad->pic:'')?>"  alt="">
</script>
<script>
    $("#meta_content").append($("#ad_position_2").html());
</script>


<?php
}
?>
